import os

#def ParseCommand(command):

def WriteConfigFilename(filename):
	file = open("rules.txt", "w")
	file.write(filename)
	file.close()

def WriteCommand(strlist):
	command = "commands.txt"
	s= "\n"
	for item in strlist[:-1]:
		s += item + "\n"

	#add last element without 
	#an extra newline
	if len(strlist) > 0:
		s += strlist[-1]

		#os.remove(command)
		#os.remove(flag)
	file = open(command, "ab")
	file.write(bytes(s, "ascii"))
	file.close()

	for item in strlist:
		strlist.remove(item)
